package com.huage.yygh.cmn.controller;

import com.huage.yygh.cmn.service.DictService;
import com.huage.yygh.common.result.Result;
import com.huage.yygh.model.cmn.Dict;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api("数字字典接口")
@RestController
@RequestMapping("/admin/cmn/dict")
public class DictController {

    @Autowired
    private DictService dictService;

    @ApiOperation("根据id获取子数据")
    @GetMapping("/getChildren/{id}")
    public Result<?> getChildren(@PathVariable Long id) {
        List<Dict> list = dictService.getChildrenById(id);
        return Result.ok(list);
    }
}
